package com.ycx.ycxmybatismanagement.controller;

import com.ycx.ycxmybatismanagement.pojo.Result;
import com.ycx.ycxmybatismanagement.service.ReportService;
import com.ycx.ycxmybatismanagement.vo.EmpGenderVo;
import com.ycx.ycxmybatismanagement.vo.EmpJobValueListVo;
import com.ycx.ycxmybatismanagement.vo.StudentCountDataVO;
import com.ycx.ycxmybatismanagement.vo.StudentDegreeDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
public class ReportController {

    @Autowired
    private ReportService reportService;

    /**
     * 统计各个职位的员工人数
     * */
    @GetMapping("/empJobData")
    public Result<EmpJobValueListVo> empJobData(){
        EmpJobValueListVo vo = reportService.empJobData();
        return Result.success(vo);
    }
    @GetMapping("/empGenderData")
    public Result<List<EmpGenderVo>> empGenderList(){
       List<EmpGenderVo> empGenderList = reportService.empGenderList();
       return Result.success(empGenderList);
    }
    @GetMapping("studentDegreeData")
    public Result<List<StudentDegreeDataVO>> studentDegreeDate(){
        List<StudentDegreeDataVO> studentDegreeDataVO = reportService.studentDegreeData();
        return Result.success(studentDegreeDataVO);
    }
    @GetMapping("/studentCountData")
    public Result<StudentCountDataVO> studentCountData(){
        StudentCountDataVO studentCountDataVO = reportService.studentCountData();
        return Result.success(studentCountDataVO);
    }


}
